Crc32Test.php 426 B

1234567891011121314151617181920212223
  1. <?php
  2. namespace Qiniu\Tests;
  3. use PHPUnit\Framework\TestCase;
  4. use Qiniu;
  5. class Crc32Test extends TestCase
  6. {
  7. public function testData()
  8. {
  9. $a = '你好';
  10. $b = \Qiniu\crc32_data($a);
  11. $this->assertEquals('1352841281', $b);
  12. }
  13. public function testFile()
  14. {
  15. $b = \Qiniu\crc32_file(__file__);
  16. $c = \Qiniu\crc32_file(__file__);
  17. $this->assertEquals($c, $b);
  18. }
  19. }