fc53f3b233
Base48 was fun but... hell yeah... let's stay standard. Public encoding of hash: ``` Block: "B..." (len: 51) Operation: "o..." (len: 51) Protocol: "P..." (len: 51) Ed25519: "tz1.." (len: 36) Contract: "TZ1.." (len: 36) NetworkdId: "id.." (len: 30) ``` Other internal prefixes (in the RPC): ``` Hash of Michelson's expression: "expr..." (len: 54) Ed25519 public key: "edpk..." (len: 54) Ed25519 secret key: "edsk..." (len: 98) Ed25519 signature: "edsig.." (len: 99) Hash of a random seed nonce: "nce...." (len: 53) Random seed: "rng...." (len: 53) ```
20 lines
397 B
OCaml
20 lines
397 B
OCaml
|
|
type 'a encoding
|
|
|
|
val simple_decode: 'a encoding -> string -> 'a option
|
|
val simple_encode: 'a encoding -> 'a -> string
|
|
|
|
type data = ..
|
|
|
|
val register_encoding:
|
|
prefix: string ->
|
|
length: int ->
|
|
to_raw: ('a -> string) ->
|
|
of_raw: (string -> 'a option) ->
|
|
wrap: ('a -> data) ->
|
|
'a encoding
|
|
|
|
val check_encoded_prefix: 'a encoding -> string -> int -> unit
|
|
|
|
val decode: string -> data option
|