bitcoin-hs-0.0.1: Partial implementation of the Bitcoin protocol (as of 2013)

Safe HaskellSafe
LanguageHaskell98

Bitcoin.Script.Integer

Contents

Description

Numbers in Bitcoin scripts

Synopsis

signs

data Sign Source #

Positive actually means non-negative here, but it looks better (and is easier to read) this way

Constructors

Positive 
Negative 

Bitcoin's special ByteString - Integer conversion

asInteger :: ByteString -> Integer Source #

Byte vectors are interpreted as little-endian variable-length integers with the most significant bit determining the sign of the integer. Thus 0x81 represents -1. 0x80 is another representation of zero (so called negative 0). Byte vectors are interpreted as Booleans where False is represented by any representation of zero, and True is represented by any representation of non-zero.