crc32

index on url or hashing considering RAM

送分小仙女□ 提交于 2019-12-09 01:04:35
问题 I am working on a project which needs to add/update around 1 million urls daily. Some days are mostly updates and some days are mostly add and some days are mix. So, on every query there is need to look up uniqueness of url in url table. How look up for url can be made really fast because at the moment index is set at url column and it works good but in coming weeks RAM would not be enough if index are kept on same column and new records will be added in millions. That's why I am looking for

Using only part of crc32

岁酱吖の 提交于 2019-12-08 10:32:31
问题 Will using only 2 upper/lower bytes of a crc32 sum make it weaker than crc16? Background: I'm currently implementing a wireless protocol. I have chunks of 64byte each, and according to Data Length vs CRC Length I would need at most crc16. Using crc16 instead of crc32 would free up bandwidth for use in Forward error correction (64byte is one block in FEC). However, my hardware is quite low powered but has hardware support for CRC32. So my idea was to use the hardware crc32 engine and just

How to build CRC32 table for Ogg?

不问归期 提交于 2019-12-08 10:08:43
问题 From this answer I adapted the code below: function _makeCRCTable() { const CRCTable = new Uint32Array(256); for (let i = 256; i--;) { let char = i; for (let j = 8; j--;) { char = char & 1 ? 3988292384 ^ char >>> 1 : char >>> 1; } CRCTable[i] = char; } return CRCTable; } This code generates table as here, but for Ogg I need another table - as here. From Ogg documentation: 32 bit CRC value (direct algorithm, initial val and final XOR = 0, generator polynomial=0x04c11db7) parseInt('04c11db7',

I need CRC Reverse Code for my CRC64 Checksum Coding [closed]

别等时光非礼了梦想. 提交于 2019-12-08 09:26:53
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 9 years ago . Can someone please code me the CRC64 Reverse Algorithm in C#? I am unable to code it, can't understand anything. Thanks, I have copied the CRC64 Checksum code from C++ and converted it into C# .NET. The entire

Javascript crc32 function and PHP crc32 not matching

送分小仙女□ 提交于 2019-12-06 04:19:10
问题 I'm working on a webapp where I want to match some crc32 values that have been generated server side in PHP with some crc32 values that I am generating in Javascript. Both are using the same input string but returning different values. I found a crc32 javascript library on webtoolkit, found here. When I try and match a simple CRC32 value that I generate in PHP, for the life of me I can't generate the same matching value in the Javascript crc32 function. I tried adding a utf-8 language

32-bit checksum algorithm better quality than CRC32?

送分小仙女□ 提交于 2019-12-05 12:04:48
Are there any 32-bit checksum algorithm with either: Smaller hash collision probability for input data sizes < 1 KB ? Collision hits with more uniform distribution. These relative to CRC32. I'm practically not counting on first property, because of limitation of storage space of 32 bits. But for the second ... seems there could be improvements. Any ideas ? Thanks. (I need concrete implementation, better in C, but C++/ C# or anything to start with is also OK). How about MurmurHash ? It is said , that this hash has good distribution (passes chi-square tests) and good avalanche effect. Also very

Reversing CRC32

泪湿孤枕 提交于 2019-12-05 08:00:32
问题 I found a code to reverse CRC32 but I don't know how it works, because im not that good in programming, I just started. I just want to compare 2 files, the old and the new one, then in the new fix the CRC32 adding 4 bytes at the end of the file, so the 2 files will have the same CRC32. Here is the code, is in C#: public class Crc32 { public const uint poly = 0xedb88320; public const uint startxor = 0xffffffff; static uint[] table = null; static uint[] revtable = null; public void FixChecksum

Matching CRC32 from STM32F0 and zlib

假如想象 提交于 2019-12-05 01:39:26
问题 I'm working on a communication link between a computer running Linux and a STM32F0. I want to use some kind of error detection for my packets and since the STM32F0 has CRC32 hw and I have zlib with CRC32 on Linux I thought it would be a good idea to use CRC32 for my project. The problem is that I won't get the same CRC value for the same data on the different platforms. #include <inttypes.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <zlib.h> int main(void) { uint8_t

How to set STM32 to generate standard CRC32

自闭症网瘾萝莉.ら 提交于 2019-12-04 18:15:08
问题 I am trying to generate CRC with STM32L4 hardware modul. I would like to validate fatfs files so basically I have byte arrays. I am using this CRC generator. Unfortunately I cannot figure out how to set STM32L4 to generate the same result. I need CRC32 and I have configuration: hcrc.Instance = CRC; /* The default polynomial is not used. It is required to defined it in CrcHandle.Init.GeneratingPolynomial*/ hcrc.Init.DefaultPolynomialUse = DEFAULT_POLYNOMIAL_DISABLE; /* Set the value of the

ceph jewel手动编译安装的一些优化

别说谁变了你拦得住时间么 提交于 2019-12-04 15:09:04
一、手动安装ceph。 根据http://my.oschina.net/linuxhunter/blog/682013,手动安装jewel版本ceph到硬件服务器。 二、测试ceph集群的方法。 使用ceph自带的rados bench命令简单测试手动搭建ceph集群的性能,查看系统性能的工具使用perf命令。由于默认安装的ubuntu环境没有安装perf工具及其依赖,所有要手动安装perf工具。#apt-get install perf linux-tools-4.4.0-21-generic。安装完成后启用两个终端分别运行#perf top命令和#rados banch -p test_rbd 60 write --no-cleanup命令。 三、发现的问题。 在运行#perf top命令的终端上发现ceph-osd在调用ceph_crc32_sctp这个函数上占用了35%的CPU时间,而此时集群的压力并不大,因此决定从源代码上找找ceph_crc32_sctp为什么占用那么多的CPU时间。 ceph_crc32_sctp这个函数位于src/common/sctp_crc32.c这个文件中,只有ceph_choose_crc32函数调用ceph_crc32_sctp函数。分析ceph_choose_crc32这个函数不难发现,该函数根据当前CPU的架构来选择计算crc32的方法