Portable typed password, passphrase, and PIN generation for MoonBit
moon test -p zhangsan2000w-art/moonbit-securegen \
--target wasm-gc --release --deny-warn
moon run src/cmd/securegen --target js --release -- --profile strict --length 24./tools/validate.sh --staticmoon check --target wasm-gc --deny-warn
MOONBIT_NEW_NATIVE=0 moon -C moonbit check --target native --deny-warn
MOONBIT_NEW_NATIVE=0 moon -C moonbit test --target native --releasemoon test -p zhangsan2000w-art/moonbit-securegen \
--target wasm-gc --release --deny-warn
moon -C examples/consumer test --target js --release --deny-warn
moon run src/cmd/securegen --target js --release -- --profile strict --length 24./tools/validate.sh --firmware./tools/validate.shbuild/FoloToy-AI-Passport-full.binPYTHON='D:/path/to/idf-python/Scripts/python.exe' ./tools/validate.sh --staticpython -m esptool --chip esp32c3 --baud 460800 \
--before default-reset --after hard-reset \
write-flash 0x0 build/FoloToy-AI-Passport-full.binpub struct PassphrasePolicy {
word_count : Int
capitalize : Bool
complete_word : Bool
separator : PassphraseSeparator
}fn PassphrasePolicy::new(word_count : Int, capitalize? : Bool, complete_word? : Bool, separator? : PassphraseSeparator) -> PassphrasePolicypub struct PasswordPolicy {
length : Int
lowercase : Bool
uppercase : Bool
digits : Bool
symbols : Bool
exclude_ambiguous : Bool
safe_symbols_only : Bool
}fn PasswordPolicy::new(length : Int, lowercase? : Bool, uppercase? : Bool, digits? : Bool, symbols? : Bool, exclude_ambiguous? : Bool, safe_symbols_only? : Bool) -> PasswordPolicypub struct RandomSource {
next : () -> UInt
}fn estimate_passphrase_entropy_bits_x10(policy : PassphrasePolicy, unique_output_count : Int) -> Intfn estimate_pin_entropy_bits_x10(length : Int) -> Intfn generate_passphrase(policy : PassphrasePolicy, dictionary : Array[String], next_u32 : () -> UInt) -> Result[String, String]fn generate_passphrase_into(next_u32 : () -> UInt, emit : (Int) -> Bool, dictionary_count : Int, dictionary_length : (Int) -> Int, dictionary_char : (Int, Int) -> Int, word_count : Int, capitalize : Bool, complete_word : Bool, separator_index : Int) -> Intfn generate_passphrase_with_source(policy : PassphrasePolicy, dictionary : Array[String], source : RandomSource) -> Result[String, String]fn generate_password_compat(next_u32 : () -> UInt, emit : (Int) -> Bool, length : Int, lowercase : Bool, uppercase : Bool, digits : Bool, symbols : Bool, exclude_ambiguous : Bool, safe_symbols_only : Bool) -> Intfn generate_password_into(policy : PasswordPolicy, next_u32 : () -> UInt, emit : (Int) -> Bool) -> Intfn generate_password_with_source(policy : PasswordPolicy, source : RandomSource) -> Result[String, String]fn generate_pin(length : Int, next_u32 : () -> UInt) -> Result[String, String]fn generate_pin_into(next_u32 : () -> UInt, emit : (Int) -> Bool, length : Int) -> Intfn unbiased_index(next_u32 : () -> UInt, bound : Int) -> Intfn validate_pin(candidate : String) -> BoolInstall
Download zipPortable typed password, passphrase, and PIN generation for MoonBit