hash

Excel formula-based function for SHA256 / SHA512 hashing without VBA or macros

为君一笑 提交于 2019-12-29 06:57:22
问题 It's the year 2017 and anybody who needs to use hashes should avoid 'broken' ones such as MD5, if security is important. Has anybody found or created a way to do more secure SHA256 or SHA512 hashing in Excel, without using VBA or macros? A spectacular example of this being done before was over 3½ years ago with MD5 (as seen in this SO: MD5 Hash function in excel without using VBA). Reason for avoiding VBA/Macros: Compatibility with mobile devices, such as Excel for iOS. Side Note: The

Vue项目部署问题及解决方案

99封情书 提交于 2019-12-29 05:35:37
Vue项目部署问题及解决方案 Vue-Router 有两种模式,默认是 hash 模式,另外一种是 history 模式。 hash :也就是地址栏里的 # 符号。比如 http://www.example/#/hello ,hash 的值为 #/hello 。特点:hash 虽然出现 URL 中,但不会被包含在 HTTP 请求中,对后端不会产生什么影响,改变 URL 不会重载页面。 history :利用了 HTML5 History Interface 中新增的 pushState () 和 replaceState () 方法,来完成 URL 跳转而无须重新加载页面。(需要特定浏览器支持) hash 和 history 两种模式都是基于 浏览器 自身的属性, vue-router 只是利用了这两个特性(底层还是浏览器提供的接口)来实现前端路由。 1、使用场景 一般来说,两种模式都是可以的。除非在意不太漂亮的 # ,只能选择 history。 这两种模式在开发环境下都没有什么太大的问题,但是当部署到生产环境中后,两者有所不同。 hash 模式部署没有什么问题,只要访问到服务器上的 index.html,就可以访问网站了。 history 模式下,前端的 URL 必须和实际向后端发起请求的 URL 一致,如 http://www.example.com/user/id

Asp.net MVC - How to hash password

隐身守侯 提交于 2019-12-29 05:33:25
问题 How do I hash an users input(password) to database and then later read the hashed password during login? I believe the solution is to hash the password upon register, where the password is saved as hashed inside db. Later upon Login, it should un-hash and compare its password with users password-input. But I don't know how to do it. I allowed password to have nvarchar(MAX) in db since hashed password are usually long. [Required] [StringLength(MAX, MinimumLength = 3, ErrorMessage = "min 3, max

Order array. undefined method `order' for Array. Convert array into hash?

我的未来我决定 提交于 2019-12-29 05:25:16
问题 I have a City model and in city's show action I want to render hotels nearby specific locations in the city. Cities has_many locations; hotels are being searched using Geocoder near method. To add order functionality I've followed Ryan Bates screencasts #228, but this approach doesn't seem to work with arrays, giving error undefined method `order' for #< Array:0x007f960d003430> cities_controller.rb helper_method :sort_column, :sort_direction def show session[:search_radius] = 2 if session[

How to elegantly rename all keys in a hash in Ruby? [duplicate]

こ雲淡風輕ζ 提交于 2019-12-29 02:17:08
问题 This question already has answers here : How to change all the keys of a hash by a new set of given keys (7 answers) Closed 3 years ago . I have a Ruby hash: ages = { "Bruce" => 32, "Clark" => 28 } Assuming I have another hash of replacement names, is there an elegant way to rename all the keys so that I end up with: ages = { "Bruce Wayne" => 32, "Clark Kent" => 28 } 回答1: ages = { "Bruce" => 32, "Clark" => 28 } mappings = {"Bruce" => "Bruce Wayne", "Clark" => "Clark Kent"} ages.map {|k, v|

Perl: Return hash from subroutine

拥有回忆 提交于 2019-12-28 18:11:20
问题 I have been trying examples for hours but I can't seem to grasp how to do what I want to do. I want to return a hash from a subroutine, and I figured a reference was the best option. Here's where it gets a bit tricky. I want to reference a hash like $hash{$x}. I am still a noob at perl :/ 1.First question, the examples I use seem to show it is ok to use $hashTable{$login}, should I be using %hashTable{$login} or does it not matter? Below is the code: sub authUser { $LocalPath = "/root

Java中HashMap底层实现原理(JDK1.8)源码分析

*爱你&永不变心* 提交于 2019-12-28 17:46:16
Java中HashMap底层实现原理(JDK1.8)源码分析 ​ 在JDK1.6,JDK1.7中,HashMap采用位桶+链表实现,即使用链表处理冲突,同一hash值的链表都存储在一个链表里。但是当位于一个桶中的元素较多,即hash值相等的元素较多时,通过key值依次查找的效率较低。而JDK1.8中,HashMap采用位桶+链表+红黑树实现,当链表长度超过阈值(8)时,将链表转换为红黑树**,这样大大减少了查找时间。 简单说下HashMap的实现原理: 首先有一个每个元素都是链表(可能表述不准确)的数组,当添加一个元素(key-value)时,就首先计算元素key的hash值,以此确定插入数组中的位置,但是可能存在同一个hash值的元素已经被放在数组同一位置了,这时就添加到同一hash值的元素的后面,它们在数组的同一位置,但是形成了链表,同一个链表上的Hash值是相同的,所以说数组存放的是链表。而当链表长度太长时,链表就转换为红黑树,这样大大提高了查找的效率。 当链表数组的容量超过初始容量的0.75时,再散列表将链表数组扩大2倍,把原链表数组搬移到新的数组中,即HashMap的原理图是: 一.JDK1.8中涉及到的数据结构 1.位桶数组 transient Node < k , v > [ ] table ; //存储(位桶)的数组</k,v> 2,数组元素Node<K,V

How do I compare two hashes in Perl without using Data::Compare?

邮差的信 提交于 2019-12-28 14:55:42
问题 How do I compare two hashes in Perl without using Data::Compare? 回答1: The best approach differs according to your purposes. The FAQ item mentioned by Sinan is a good resource: How do I test whether two arrays or hashes are equal?. During development and debugging (and of course when writing unit tests) I have found Test::More to be useful when comparing arrays, hashes, and complex data structures. A simple example: use strict; use warnings; my %some_data = ( a => [1, 2, 'x'], b => { foo =>

How do I compare two hashes in Perl without using Data::Compare?

删除回忆录丶 提交于 2019-12-28 14:53:32
问题 How do I compare two hashes in Perl without using Data::Compare? 回答1: The best approach differs according to your purposes. The FAQ item mentioned by Sinan is a good resource: How do I test whether two arrays or hashes are equal?. During development and debugging (and of course when writing unit tests) I have found Test::More to be useful when comparing arrays, hashes, and complex data structures. A simple example: use strict; use warnings; my %some_data = ( a => [1, 2, 'x'], b => { foo =>

Why does C# generate different EXEs for the same source-code?

自作多情 提交于 2019-12-28 12:28:34
问题 Every time we recompile our C# application we end up with EXEs with different MD5 signatures. We are recompiling on the same machine, minutes apart. Why doesn't the same source-code yield the same output? Is there a way to fix this? 回答1: "So every assembly has: A Timestamp, in two locations A GUID that matched the PDB What appears to be a completely random GUID generated every compile. A counter indicating what the build of the assembly is - generated only in subsequent Visual Studio builds."