Hi,

It's the same result after the change you suggested.

Then I tried in regular expression to remove $. After that I've got the
result below:
//this works, but last format is not changed
//var bytes = srcBean.getDatasetFirstBinaryValueById("objectGUID");
//var hex = new
java.lang.String(org.apache.commons.codec.binary.Hex.encodeHex(bytes));
var hex = new
java.lang.String(org.apache.commons.codec.binary.Hex.encodeHex(srcBean.getDatasetFirstBinaryValueById("objectGUID")));
print("Value hex: " + hex);
var guidString =
hex.replace(/^(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)(..)/,"$4$3$2$1-$6$5-$8$7-$9$10-$11$12$13$14$15$16");
print("Value guidString: " + guidString);
guidString;

And print output:
Aug 28 15:50:43 - INFO  - Starting sync for LDAPUserCreate
Value hex: 7277143defbfbdefbfbd1b45efbfbd13efbfbd4cefbfbddc9a30
Value guidString: 3d147772-bfef-efbd-bfbd-1b45efbfbd13efbfbd4cefbfbddc9a30

But I'm expecting value which is not like that. From this concrete
objectGUID I'm providing a screenshot from the Active Directory, where you
can see the representation of value.
Now I'm not even sure if the first "hex" value is the correct value.

Regards,
Matjaž


V V pet., 28. avg. 2020 ob 15:32 je oseba Soisik Froger <
soisik.fro...@worteks.com> napisala:

> On 28/08/2020 15:16, Matjaz Premerl wrote:
> > var bytes = srcBean.getDatasetFirstBinaryValueById("objectGUID");
> > var hex = new
> java.lang.String(org.apache.commons.codec.binary.Hex.encodeHex(bytes));
> Could you try this instead of these two lines ?
>
> var hex = new
> java.lang.String(org.apache.commons.codec.binary.Hex.encodeHex(srcBean.getDatasetFirstBinaryValueById("objectGUID")));
>
> --
> Soisik Froger | Software Architect
>
> soisik.fro...@worteks.com
>
> Worteks | https://www.worteks.com
> _______________________________________________________________
> Ldap Synchronization Connector (LSC) - http://lsc-project.org
>
> lsc-users mailing list
> lsc-users@lists.lsc-project.org
> https://lists.lsc-project.org/cgi-bin/mailman/listinfo/lsc-users
_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org

lsc-users mailing list
lsc-users@lists.lsc-project.org
https://lists.lsc-project.org/cgi-bin/mailman/listinfo/lsc-users

Reply via email to