Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SecureRandom & Base64

 
James Dekker
Ranch Hand
Posts: 221
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All,

Am new to this...

What is the *BEST* way to create a SecureRandom number and then convert it to BASE64?

This is what I have so far:



Thank you,

James
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure that there is "a best way". The way you're using it seems fine, although I'd probably use a different library for base-64 encoding (like Jakarta Commons Codec). But that's a minor detail.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic