ZillaYT <zill...@gmail.com> writes:

> I have this simple code and it works on my Macs groovy
>
> String sigStr = 'iurpeirupru04790734'
> sigStr = sigStr.digest('SHA-1')
> println sigStr

Try

    sigStr = sigStr.decodeBase64()

which is available since Groovy 1.0 [1]

digest() is available since 2.5.0 [2].

[1] 
http://docs.groovy-lang.org/2.4.0/html/api/org/codehaus/groovy/runtime/EncodingGroovyMethods.html
[2] 
http://docs.groovy-lang.org/latest/html/api/org/codehaus/groovy/runtime/EncodingGroovyMethods.html

> But I get this error when I run it in a Jenkins pipeline. Why? Thanks!

Different Groovy version?

> hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No 
> signature of method: java.lang.String.digest() is applicable for argument 
> types: (java.lang.String) values: [SHA-1] Possible solutions: getAt(java.
> lang.String), size(), toSet(), size(), next(), toList()

-- 
Mykola

Libre/Free Java Software Developer
https://manandbytes.gitlab.io/

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/87bm0mh469.fsf%40think.
For more options, visit https://groups.google.com/d/optout.

Reply via email to