231 append pseudorandom
This commit is contained in:
@@ -122,14 +122,19 @@ component /*https://www.bennadel.com/blog/2976-trying-to-generate-cryptographica
|
||||
*/
|
||||
private string function encodeBytes( required binary bytes ) {
|
||||
|
||||
var token = binaryEncode( bytes, "base64" );
|
||||
var token = binaryEncode( bytes, "base64" ); // *** вот поэтому длина отличается от заявленной
|
||||
|
||||
// Replace the characters that are not allowed in the base64url format. The
|
||||
// characters [+, /, =] are removed for URL-based base64 values because they
|
||||
// have significant meaning in the context of URL paths and query-strings.
|
||||
token = replace( token, "+", "-", "all" );
|
||||
/*token = replace( token, "+", "-", "all" );
|
||||
token = replace( token, "/", "_", "all" );
|
||||
token = replace( token, "=", "", "all" );
|
||||
token = replace( token, "=", "", "all" ); */
|
||||
|
||||
// мы хотим убрать все спецсимволы, потому что мы используем токен в качестве псевдослучайного суффикса
|
||||
token = replace( token, "+", "a", "all" );
|
||||
token = replace( token, "/", "b", "all" );
|
||||
token = replace( token, "=", "c", "all" );
|
||||
|
||||
return( token );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user