0

I am using JMeter to generate random number for load test

Q) How to encode the long value below "DI"? The original value is 200.

7|0|8|http://10.6.3.1:90/portal/|E5514987BAA783F640F3B2046EE770BB|com.portal.shared.Rpc|process|java.lang.String/2004016611|J|60182009111|password|1|2|3|4|3|5|6|5|7|DI|8|

Some solution being posted here but's it been more than a decade ago . Any newer solution?

Banana Tech
  • 347
  • 1
  • 6
  • 18

2 Answers2

1

The value is base64 encoded. Use com.google.gwt.user.server.Base64Utils.longFromBase64(long) to create a string that represents a given value, or Base64Utils.longFromBase64(String) to read a string and convert it into a long value, to see what it represents.

Colin Alworth
  • 17,801
  • 2
  • 26
  • 39
  • Hi, you are close, but the value converted to long224564. Check out my answer. – Banana Tech May 10 '22 at 03:47
  • Yes, you are using the client version of the code in your answer, which only works when compiled to JS. The code in my answer works from any jvm, so is usually easier to work with when incorporating with some other tooling. I can't confirm that this doesn't work, `System.out.println(Base64Utils.longFromBase64("DI"))` definitely logs "200". – Colin Alworth May 10 '22 at 15:16
0

After reading the open source code. I managed to find how to encode.

System.out.println("converted value=" + com.google.gwt.lang.LongLib.toBase64(200));

converted value=DI

Banana Tech
  • 347
  • 1
  • 6
  • 18