Newbies bff1985 Posted January 10, 2013 Newbies Posted January 10, 2013 Is it possible to pass SMSetVariable a string of text and not have it change the ¶ character? Let me explain in more detail. My company currently uses the Troi Plugin to hash large strings of text. We developed a function with Scriptmaster/Groovy that will hash our strings. However, we need all of our previous hashes that were hashed using troi to be equal to a hash that we would be able to create with our current solution. For example if we were to go back and rehash a string, it must be equal to the previous string that was hashed by troi. This works fine until a string containing the ¶ character is involved. From what I understand, the SMSetVariable function converts the ¶ character to a more groovy friendly newline character. The problem lies in the fact that a different hash would be produced due to different unicode characters being involved. Does anybody have any creative input on this. Any help is greatly appreciated. -Brian
Karsten Wolf Posted January 11, 2013 Posted January 11, 2013 Write the string to a temp file and hash the file. See post sha256 encryption
Newbies bff1985 Posted January 11, 2013 Author Newbies Posted January 11, 2013 Thank you for the response. The solution you have described does work however my company deals with patient medical data and saving text files of patient information is not a solution that my employer will allow. While I realize that I could delete the files afterward, it is still not a solution that will be acceptable. Is it possible to find the source code for the SMSetVariable and simply rewrite it so that it does not convert the ¶? I appreciate your help thus far.
john renfrew Posted January 12, 2013 Posted January 12, 2013 How about text = text.replace('n' , 'rn') inside the function before you do the hash?? How about posting a simple example from Troi to see if we can get the same solution, otherwise its just all a bit of theory?? Is is 'literally' the ¶ (pilcrow) character or a new line from FileMaker?? And why are you using the SMSetVarible methodology?? If you register the Groovy function as an external function then you can pass the text as a parameter each time you need to convert the text. Maybe that will not do the conversion??
Karsten Wolf Posted January 12, 2013 Posted January 12, 2013 I don't think, the implementation of SMSetVariable is available. And if it were you'd be in trouble of updating it along with the main line of the plugin. Have you tried using parameters and return values (although they might be using SMSetVariable internally)? Another possibility may be replacing all the ¶ characters with something very unlikely like a UUID, passing that replacement text to the hash function and replace back inside groovy.
Recommended Posts
This topic is 4345 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now