query
On this page

fromHexString

lib.fromHexString

Docs pulled from | This Revision | 43 minutes ago


Convert a hexadecimal string to it's integer representation.

Type

fromHexString :: String -> [ String ]

Examples

fromHexString "FF"
=> 255

fromHexString (builtins.hashString "sha256" "test")
=> 9223372036854775807
(lib.trivial.fromHexString)

Noogle detected

Aliases

Implementation

The following is the current implementation of this function.

fromHexString = value:
  let
    noPrefix = lib.strings.removePrefix "0x" (lib.strings.toLower value);
  in let
    parsed = builtins.fromTOML "v=0x${noPrefix}";
  in parsed.v;