Skip to content

KeyGenerator from string #278

@dgarcia360

Description

@dgarcia360

While explaining the metadata / mosaic transactions, I found challenging to follow the examples if we have to refer to the key as random UInt64 value that the dev has to store its meaning in a separate database.

To permit the dev to use NEM as a fully decentralized service without having to store data somewhere else and enhance the usability in the SDK, we could provide with a KeyGenerator that takes a string as an input and returns a deterministic UInt64 object.

You can see how this is possible currently using the NamespaceIdGenerator (https://github.com/nemtech/nem2-docs/blob/master/source/resources/examples/typescript/restriction/RestrictingMosaicsTransfersMosaicGlobalRestriction.ts#L42).

In the docs, we can explain more about the maximum value the string can have to be translated to a valid UInt64 value, as well as if can contain special chars or not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions