Comments (4)
Wow! Nice catch.
Of course, any PR is very welcome!
from typhoon.
Hey @daria-kopaliani,
I reviewed the code again, I can't understand why this shift is invalid?
This is "31 multiply" hash function well known in Java world,
https://docs.oracle.com/javase/6/docs/api/java/lang/String.html#hashCode()
So the hash function is
hash = 31 * hash + value
or hash = hash << 5 - hash + value
See more details in this answer:
https://stackoverflow.com/a/299748/1817391
I suggest to do 31 multiplication if shift is not working anymore.
Meanwhile XOR is not good for hash, because A ^ B == B ^ A
from typhoon.
Hello @daria-kopaliani, sorry for long delay. I'm going to fix this issue.
Can you remember how this issue happened? Was it 32bit device? I'm unable to replicate it.
from typhoon.
Well.. I found the reason of that problem. There is a typo 5 << hash
instead of hash << 5
🤦, so instead of shifting hash by 5 bits to right, I shifted 5 by hash
bits to right. It looks like your compile flags were set to stop when shifting happens by more than 32 bits at once (as I know it's unexpected behaviour)..
from typhoon.
Related Issues (20)
- Plist Integration in Ios App Extensions
- Not compiled Xcode 9.3 HOT 2
- Flash back crash at startup HOT 1
- Carthage error 65 HOT 4
- Unable to compile after migrating from 3.5.1 to 4.0.5 HOT 5
- Resolve-by-type for ViewController using storyboard HOT 8
- TyphoonDefinition.withClass + classOrProtocolForAutoInjection => Making both work together HOT 1
- PodSpec 4.0.6 HOT 1
- Circular reference level depth HOT 8
- Multiple instances injected into view controller when using storyboard reference HOT 2
- Not all test are run on Travis, example app exception HOT 1
- TyphoonDefinition withConfigName:bundle: does not behave as expected when running tests
- TyphoonStoryboard swift not working HOT 1
- ios 13 Beta crash HOT 2
- cannot run tests HOT 1
- Insecure functions (malloc and memcpy) are used HOT 3
- Injecting a simple object through modularized assembly causes crash
- Framework target HOT 3
- How to get an instance from Typhoon? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typhoon.