MatthewKing / DeviceId

A simple library providing functionality to generate a 'device ID' that can be used to uniquely identify a computer.
MIT License
722 stars 118 forks source link

Convert String to Component #57

Closed krulci closed 2 years ago

krulci commented 2 years ago

After creating a deviceId, how do you convert it back if you know the conponents of builder? I am trying to create a client and server communication.

MatthewKing commented 2 years ago

This depends on which implementation of IDeviceIdFormatter and IDeviceIdComponentEncoder that you use.

Out of the box, it's a one-way process and you can't go back. Think of it like a hash.

But you could implement your own reversible version if you want - just implement IDeviceIdFormatter and pass it to your builder with the .UseFormatter method.