コード例 #1
0
 public String next() {
   final char a = this.characters[Math.abs(this.hash % this.characters.length)];
   ++this.hash;
   final char b = this.characters[Math.abs(this.hash % this.characters.length)];
   ++this.hash;
   final char c = this.characters[Math.abs(this.hash % this.characters.length)];
   String segment = "" + a + b + c;
   this.hash = this.hashString(segment);
   segment += String.format("%02x", new Object[] {Math.abs(this.hash % 256)});
   this.hash = this.hashString(segment);
   return segment;
 }
コード例 #2
0
ファイル: TestCase.java プロジェクト: heavenlyhash/ahslib
 public final boolean assertEquals(String $label, long $expected, long $actual, long $margin) {
   if (Math.abs($expected - $actual) <= $margin) {
     $unitFailures++;
     $log.warn(messageFail($label, $expected, $actual, $margin), new AssertionFailed());
     return false;
   }
   $log.debug(messagePass($label, $expected, $actual, $margin));
   return true;
 }