Generating API tokens using node

后端 未结 4 1441
野趣味
野趣味 2021-02-01 20:28

I am writing an app that will expose an API. The application allows people to create workspaces and add users to them. Each user will have a unique token. When they make an API

4条回答
  •  萌比男神i
    2021-02-01 21:25

    Why not just use UUIDv4 if you are looking for something unique? If you are interested in some other type of hashing (as mentioned previous hat is a good choice), you might look at speakeasy - https://github.com/markbao/speakeasy. It not only generates random keys but it can also create timebased twofactor authentication keys if you ever really want to layer on additional security strength.

提交回复
热议问题