Add JSON
All checks were successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/all-checks-complete Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/all-checks-complete Pipeline was successful

This commit is contained in:
Smaug123
2023-09-07 20:25:13 +01:00
parent 1b1c902667
commit 98014df27d
35 changed files with 1407 additions and 113 deletions

24
AnkiStatic.Lib/Base91.fs Normal file
View File

@@ -0,0 +1,24 @@
namespace AnkiStatic
open System.Text
[<RequireQualifiedAccess>]
module internal Base91 =
// Replicating the Anki algorithm
let private chars =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ "0123456789"
+ "!#$%&()*+,-./:;<=>?@[]^_`{|}~"
let toString (input : uint64) : string =
let output = StringBuilder ()
let mutable input = input
while input > 0uL do
let modded = int (input % (uint64 chars.Length))
let div = input / (uint64 chars.Length)
input <- div
output.Append chars.[modded] |> ignore
output.ToString ()