Skip to content

Latest commit

 

History

History
86 lines (49 loc) · 2.41 KB

onion_binary.md

File metadata and controls

86 lines (49 loc) · 2.41 KB

Module onion_binary

Binary Utility API.

Authors: Alexander Færøy (ahf@0x90.dk).

Description

This module contains various utility functions that are found useful when working with binaries.

Function Index

bit/2Get the bit value at a given position of a binary.
bits/1Show the binary representation of a given binary.
fingerprint/1Get the fingerprint of a given binary.
fingerprint/2Apply the hash algorithm to the input and get the fingerprint.
trim/2

Function Details

bit/2


bit(Subject, Position) -> 0 | 1
  • Subject = binary()
  • Position = non_neg_integer()

Get the bit value at a given position of a binary.

bits/1


bits(Subject) -> [Bit]
  • Subject = binary()
  • Bit = 0 | 1

Show the binary representation of a given binary.

fingerprint/1


fingerprint(Data) -> binary()
  • Data = binary()

Get the fingerprint of a given binary.

fingerprint/2


fingerprint(Hash, Data) -> binary()

Apply the hash algorithm to the input and get the fingerprint.

trim/2


trim(Subject, Pattern) -> Result
  • Subject = binary()
  • Pattern = binary() | [binary()]
  • Result = binary()