Sha256: 5bd8ba13b59c15564ceee9798c77eb42d839415b8e2532dc7bf158fe003a7eda
Contents?: true
Size: 433 Bytes
Versions: 98
Compression:
Stored size: 433 Bytes
Contents
module Hexadecimal open System let private isValid char = "0123456789ABCDEF".Contains(string char) let private charToDecimal (char: char) = if Char.IsDigit(char) then (int)char - (int)'0' else (int)(char) - (int)'A' + 10 let toDecimal(input: string) = let chars = input.ToUpperInvariant().ToCharArray() if Array.forall isValid chars then Array.fold (fun acc c -> acc * 16 + charToDecimal c) 0 chars else 0
Version data entries
98 entries across 98 versions & 1 rubygems