Search code examples
javascriptnode.jsstringdecodeencode

How to encode ObjectID in MongoDB or Strings


How to encode ObjectID in MongoDB or just strings in general. I want to encode this ObjectID that I have in MongoDB 5c8c8927c9c093b288acf44e so that later on I can decode it and get the same value.


Solution

  • You can use the Advanced Encryption Standard (AES) technique. Its an symmetric encryption algorithm.

    You can encode and decode strings with 1 password.