package sihl
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
The Sihl web framework
Install
dune-project
Dependency
Authors
Maintainers
Sources
2.0.1.tar.gz
md5=52b28d3faac0a2243735285aa3f962aa
sha512=e7ff89bdba9f1afa3b115a056ae3d403f602685187a968485ea64a7cd1a18791f66b7480b682bf66acd3564dd89139162779d58a43c2389d785c98e246094a18
doc/src/sihl/core_random.ml.html
Source file core_random.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32let () = Caml.Random.self_init () let rec chars result n = if n > 0 then chars (List.cons (Char.chr (Caml.Random.int 255)) result) (n - 1) else result |> List.to_seq |> String.of_seq ;; let bytes nr = chars [] nr let base64 nr = Base64.encode_string ~alphabet:Base64.uri_safe_alphabet (bytes nr) ;; exception Exception of string let random_cmd = Core_command.make ~name:"random" ~help:"<number of bytes>" ~description: "Generates a random string with the given length in bytes. The string is \ base64 encoded. Use the generated value for SIHL_SECRET." (function | [ n ] -> (match int_of_string_opt n with | Some n -> print_endline @@ base64 n; Lwt.return @@ Some () | None -> failwith "Invalid number of bytes provided") | _ -> Lwt.return None) ;;
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>