Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| <?php | |
| namespace Acme\Bundle\AppBundle\Form\EventListener; | |
| use Symfony\Component\Form\Event\DataEvent; | |
| use Symfony\Component\Form\FormFactoryInterface; | |
| use Symfony\Component\EventDispatcher\EventSubscriberInterface; | |
| use Symfony\Component\Form\FormEvents; | |
| class IsAdminFieldSubscriber implements EventSubscriberInterface |
| CRC检验码计算 | |
| 1.需求分析 | |
| CRC 中文名叫循环冗余校验,这个给技术是数据通讯领域中最常用的一种差错校验码,特点是校验字符串跟信息都可以自定。课题要求是编程实现CRC,并且校验数据的正确性。 | |
| CRC的基本原理是在第K位信息码后面再接R位的校验码,整个信息的长度为N为,所以又可以叫做(N,K)码。对于给定的CRC信息码,可以证明证明存在一个最高次幂为N-K的多项式G(x)。根据G(x)可以生成K位的信息的校验码,G(x)叫做这个CRC信息码的生成多项式。 | |
| 校验码的具体生成过程是:假设原信息用多项式表示,讲C(x)左移R位,则可以表示成C(x)*2的R次方除以生成的多项式G(x),得到余数就是校验码。 | |
| 设计算法: | |
| 1.将x的最高幂次为R的多项式G(x)转换成对应的二进制数,长度为R+1位. | |
| 2.将信息码左移R位,相当于对应的信息多项式C(x)*2的R次方. |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| 我不是神话拉 |