Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

238
Views
Base 64 encoding of byte array in rhino js

I am trying to to do a base64 encode of byte array. However, I am limited for choices. btoa() method is not supported by Rhino Javascript engine. Is there a way this can be achieved.

Below snippet error that rhino js does not support.

java.util.concurrent.ExecutionException: javax.script.ScriptException: ReferenceError: "btoa" is not defined.

Below is snippet of code.

var encodedData = btoa(stringToEncode);

I am trying to encode salted sha256 byte array into base64.

var md = java.security.MessageDigest.getInstance('SHA-256');
md.update(salt);
var sha256Bytes = []
sha256Bytes=md.digest(new java.lang.String(givenPassword).getBytes('UTF-8'))
var sha256Hash = btoa(sha256Bytes);
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!