Skip to content

Commit

Permalink
Just adding Ben Style.
Browse files Browse the repository at this point in the history
No functional changes - just applying my own formatting to James Moberg's update.
  • Loading branch information
bennadel committed Jan 17, 2023
1 parent 4cde7a2 commit 321d067
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/Cuid2.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,14 @@ component
// variable-length string.
var result = BigIntegerClass
.init( bytes )
.toString( 36 );
// NOTE: In the JavaScript version of CUID2, Eric Elliott removes the first
// two letters of the hash. His note says that the first two letters bias the
.toString( 36 )
;

// NOTE: In the JavaScript version of CUID2, Eric Elliott removes the first two
// letters of the hash. His note says that the first two letters bias the
// generated CUIDs towards a narrower set of values. Anecdotally, I do see the
// dash ("-") showing up a lot unless I remove the first 2 characters as well.
result = right(result, len(result)-2);

return( result );
return( result.right( result.len() - 2 ) );

}

Expand Down

0 comments on commit 321d067

Please sign in to comment.