Principal

IC principals (User and canister IDs)

Principal

type Principal = Prim.Types.Principal

Internet Computer principal identifiers. Convert to Blob for access to bytes.

fromActor

let fromActor : (a : actor {  }) -> Principal

Conversion.

toBlob

let toBlob : (p : Principal) -> Blob

Conversion.

toText

func toText(p : Principal) : Text

Conversion.

hash

func hash(principal : Principal) : Hash.Hash

fromText

func fromText(t : Text) : Principal

equal

func equal(x : Principal, y : Principal) : Bool

Returns x == y.

notEqual

func notEqual(x : Principal, y : Principal) : Bool

Returns x != y.

less

func less(x : Principal, y : Principal) : Bool

Returns x < y.

lessOrEqual

func lessOrEqual(x : Principal, y : Principal) : Bool

Returns x ⇐ y.

greater

func greater(x : Principal, y : Principal) : Bool

Returns x > y.

greaterOrEqual

func greaterOrEqual(x : Principal, y : Principal) : Bool

Returns x >= y.

compare

func compare(x : Principal, y : Principal) : {#less; #equal; #greater}

Returns the order of x and y.