Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Tino
New Member

How to hash string using sha1?

I have 4 variables i want to combine as a string and then use the hash them with sha1, the output should be a 40-char hexidecimal string, for example 6b76a4ede12897d42dabc2a5f9270bbdb76985af.

 

I want to do something like this

hash = sha1(callerId + time + key + unique)

 

Is there anyway i can use R-Script to do this?

1 REPLY 1
v-yuezhe-msft
Employee
Employee

@Tino,

Write your R script to hash string with sha1 following the instructions in this article .

Then you can use R.Excute(text) function to call the local R script as a data source in Power BI Desktop, for more details see this blog: http://blog.gbrueckl.at/2016/05/running-local-scripts-power-bi/ .

There is also a similar thread for your reference:
http://community.powerbi.com/t5/Desktop/Invoke-Function-writtein-in-R/m-p/87847

Regards,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.