/**
 * Encodes a identity object to a base64 so that users
 * don't think they have to add them as nested json
 */ export const encodeIdentity = ( identity ) => Buffer . from ( JSON . stringify ( identity ) ) . toString ( `base64` ) ; see encodeIdentity export const decodeIdentity = ( token ) => JSON . parse ( Buffer . from ( token , `base64` ) . toString ( ) ) ;