src/Pure/General/sha1_polyml.ML
changeset 43948 8f5add916a99
parent 41954 fb94df4505a0
child 53211 753b9fbe18be
equal deleted inserted replaced
43947:9b00f09f7721 43948:8f5add916a99
    16 fun hex_string arr i =
    16 fun hex_string arr i =
    17   let val c = CInterface.fromCchar (CInterface.offset i CInterface.Cchar arr)
    17   let val c = CInterface.fromCchar (CInterface.offset i CInterface.Cchar arr)
    18   in (op ^) (pairself hex_digit (Integer.div_mod (Char.ord c) 16)) end
    18   in (op ^) (pairself hex_digit (Integer.div_mod (Char.ord c) 16)) end
    19 
    19 
    20 val lib_path =
    20 val lib_path =
    21   ("$ML_HOME/" ^ (if String.isSuffix "cygwin" ml_platform then "sha1.dll" else "libsha1.so"))
    21   ("$ML_HOME/" ^ (if ML_System.platform_is_cygwin then "sha1.dll" else "libsha1.so"))
    22   |> Path.explode;
    22   |> Path.explode;
    23 
    23 
    24 fun digest_external str =
    24 fun digest_external str =
    25   let
    25   let
    26     val digest = CInterface.alloc 20 CInterface.Cchar;
    26     val digest = CInterface.alloc 20 CInterface.Cchar;