org.springframework.security.crypto.bcrypt.BCrypt.decode_base64()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(180)

本文整理了Java中org.springframework.security.crypto.bcrypt.BCrypt.decode_base64()方法的一些代码示例,展示了BCrypt.decode_base64()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BCrypt.decode_base64()方法的具体详情如下:
包路径:org.springframework.security.crypto.bcrypt.BCrypt
类名称:BCrypt
方法名:decode_base64

BCrypt.decode_base64介绍

[英]Decode a string encoded using bcrypt's base64 scheme to a byte array. Note that this is not compatible with the standard MIME-base64 encoding.
[中]将使用bcrypt的base64方案编码的字符串解码为字节数组。请注意,这与标准MIME-base64编码兼容。

代码示例

代码示例来源:origin: spring-projects/spring-security

saltb = decode_base64(real_salt, BCRYPT_SALT_LEN);

代码示例来源:origin: spring-projects/spring-security

@Test(expected = IllegalArgumentException.class)
public void decodingMustRequestMoreThanZeroBytes() {
  BCrypt.decode_base64("", 0);
}

代码示例来源:origin: spring-projects/spring-security

@Test
public void decodingOnlyProvidesAvailableBytes() {
  assertThat(BCrypt.decode_base64("", 1)).isEmpty();
  assertThat(BCrypt.decode_base64("......", 3)).hasSize(3);
  assertThat(BCrypt.decode_base64("......", 4)).hasSize(4);
  assertThat(BCrypt.decode_base64("......", 5)).hasSize(4);
}

代码示例来源:origin: org.springframework.security/spring-security-core

saltb = decode_base64(real_salt, BCRYPT_SALT_LEN);

代码示例来源:origin: spring-projects/spring-security

@Test
public void decodingStopsWithFirstInvalidCharacter() {
  assertThat(BCrypt.decode_base64("....", 1)).hasSize(1);
  assertThat(BCrypt.decode_base64(" ....", 1)).isEmpty();
}

代码示例来源:origin: spring-projects/spring-security

@Test
public void decodingCharsOutsideAsciiGivesNoResults() {
  byte[] ba = BCrypt.decode_base64("ππππππππ", 1);
  assertThat(ba).isEmpty();
}

代码示例来源:origin: spring-projects/spring-security

/**
 * Encode and decode each byte value in each position.
 */
@Test
public void testBase64EncodeDecode() {
  byte[] ba = new byte[3];
  for (int b = 0; b <= 0xFF; b++) {
    for (int i = 0; i < ba.length; i++) {
      Arrays.fill(ba, (byte) 0);
      ba[i] = (byte) b;
      String s = encode_base64(ba, 3);
      assertThat(s.length()).isEqualTo(4);
      byte[] decoded = BCrypt.decode_base64(s, 3);
      assertThat(decoded).isEqualTo(ba);
    }
  }
}

代码示例来源:origin: org.springframework.security/spring-security-crypto

saltb = decode_base64(real_salt, BCRYPT_SALT_LEN);

代码示例来源:origin: org.springframework.security/org.springframework.security.core

saltb = decode_base64(real_salt, BCRYPT_SALT_LEN);

代码示例来源:origin: apache/servicemix-bundles

saltb = decode_base64(real_salt, BCRYPT_SALT_LEN);

代码示例来源:origin: apache/servicemix-bundles

saltb = decode_base64(real_salt, BCRYPT_SALT_LEN);

相关文章