Binary Utility API.
Authors: Alexander Færøy (ahf@0x90.dk
).
This module contains various utility functions that are found useful when working with binaries.
bit/2 | Get the bit value at a given position of a binary. |
bits/1 | Show the binary representation of a given binary. |
fingerprint/1 | Get the fingerprint of a given binary. |
fingerprint/2 | Apply the hash algorithm to the input and get the fingerprint. |
trim/2 |
bit(Subject, Position) -> 0 | 1
Subject = binary()
Position = non_neg_integer()
Get the bit value at a given position of a binary.
bits(Subject) -> [Bit]
Subject = binary()
Bit = 0 | 1
Show the binary representation of a given binary.
fingerprint(Data) -> binary()
Data = binary()
Get the fingerprint of a given binary.
fingerprint(Hash, Data) -> binary()
Hash = crypto:hash_algorithm()
Data = binary()
Apply the hash algorithm to the input and get the fingerprint.
trim(Subject, Pattern) -> Result
Subject = binary()
Pattern = binary() | [binary()]
Result = binary()