合规国际互联网加速 OSASE为企业客户提供高速稳定SD-WAN国际加速解决方案。 广告
`SCryptPasswordEncoder`实现使用scrypt算法来对密码进行哈希处理。 为了在自定义硬件上破解密码破解scrypt是一种故意慢的算法,需要大量内存。 与其他自适应单向函数一样,应调整大约需要1秒钟来验证系统上的密码。 ~~~ // Create an encoder with all the defaults SCryptPasswordEncoder encoder = new SCryptPasswordEncoder(); String result = encoder.encode("myPassword"); assertTrue(encoder.matches("myPassword", result)); ~~~