Repository: joke2k/faker

Issue:
Not possible to seed .binary()
It is not possible to seed the method ``binary`` (see also issue #484)

```
>>> from faker import Faker
>>> f1 = Faker()
>>> f1.seed(4321)
>>> print(f1.binary()[0:100])
b'm\x17 ;\xca\x88\xb6\xb1\x8c/6Qmo\x02\xfa\xc3g\xf9R\xc5\xc6\x84\n\xac\xa3\x99\xb9Xs\xc3D\xa5g\xbb\xe5YU)\x95\tt\x0fsy\xe3\xaa\xfc\xaa\xb7\xb9\xfd\xac\x88\x13\xe2\xb1!\xbc\xea\x00\xd3]"\x9c;\xf2\xecx\xee\xe1\x06\xa6_\x9by\x97\xc3\xd7\xf6\x87&\x8fM\x90{\x18\xb0/\xdf\xcf$*\xde\x13\xc1\x96&\x12\xc2'
>>> f2 = Faker()
>>> f2.seed(4321)
>>> print(f2.binary()[0:100])
b"\xc1Xf\x81\xba\xe8P\xcb\xb2\xfd\x8e\x8bz7'\xe0\x7f\xef\xdej\xf5\xb8\xf1\xe4\x97v\x7f\x9aM\xfb\xee\xabT\x17\x9c\xb7\xa6\x8f\xd1\x8c\x07l0\xc5&*\xd8\xf2B\xbf\xbe\xe8\xca\xbe\xe8\xdf\xec4\xd2\xc1\xff\xecI\xc9\xdc\xae\x92~|\xa1\x0ch\x08\\G\xd7\xd8\xf0I\xc0\xcaLR\xaa\xd6{%\xfa\x14\xd9C\x9f\x1fK\x14\xc0s?O)"
```

Comments:

Patch:
diff --git a/faker/providers/color/hr_HR/__init__.py b/faker/providers/color/hr_HR/__init__.py
new file mode 100644
index 00000000..cf063762
--- /dev/null
+++ b/faker/providers/color/hr_HR/__init__.py
@@ -0,0 +1,160 @@
+# coding=utf-8
+from __future__ import unicode_literals
+
+from collections import OrderedDict
+
+from .. import Provider as ColorProvider
+
+localized = True
+
+
+class Provider(ColorProvider):
+    all_colors = OrderedDict((
+        ('Akvamarin', '#7FFFD4'),
+        ('Antikna bijela', '#FAEBD7'),
+        ('Azurna', '#F0FFFF'),
+        ('Bež', '#F5F5DC'),
+        ('Bijela', '#FFFFFF'),
+        ('Bijelo bilje', '#FFFAF0'),
+        ('Bjelokost', '#FFFFF0'),
+        ('Blijeda kudelja', '#EEE8AA'),
+        ('Blijedi badem', '#FFEBCD'),
+        ('Blijedoljubičasta', '#DB7093'),
+        ('Blijedotirkizna', '#AFEEEE'),
+        ('Blijedozelena', '#98FB98'),
+        ('Breskva', '#FFDAB9'),
+        ('Brončana', '#D2B48C'),
+        ('Čeličnoplava', '#4682B4'),
+        ('Čičak', '#D8BFD8'),
+        ('Cijan', '#00FFFF'),
+        ('Čipka', '#FDF5E6'),
+        ('Čokoladna', '#D2691E'),
+        ('Crna', '#000000'),
+        ('Crvena', '#FF0000'),
+        ('Dim', '#F5F5F5'),
+        ('Dodger plava', '#1E90FF'),
+        ('Duboko ružičasta', '#FF1493'),
+        ('Fuksija', '#FF00FF'),
+        ('Gainsboro', '#DCDCDC'),
+        ('Grimizna', '#DC143C'),
+        ('Indigo', '#4B0082'),
+        ('Jelenska koža', '#FFE4B5'),
+        ('Kadetski plava', '#5F9EA0'),
+        ('Kestenjasta', '#800000'),
+        ('Koraljna', '#FF7F50'),
+        ('Kraljevski plava', '#4169E1'),
+        ('Kudelja', '#DAA520'),
+        ('Lan', '#FAF0E6'),
+        ('Lavanda', '#E6E6FA'),
+        ('Limun', '#FFFACD'),
+        ('Lipa', '#00FF00'),
+        ('Ljubičasta', '#EE82EE'),
+        ('Magenta', '#FF00FF'),
+        ('Maslinasta', '#808000'),
+        ('Medljika', '#F0FFF0'),
+        ('Menta', '#F5FFFA'),
+        ('Modro nebo', '#00BFFF'),
+        ('Modrozelena', '#008080'),
+        ('Mornarska', '#000080'),
+        ('Morskozelena', '#2E8B57'),
+        ('Mračno siva', '#696969'),
+        ('Narančasta', '#FFA500'),
+        ('Narančastocrvena', '#FF4500'),
+        ('Narančastoružičasta', '#FA8072'),
+        ('Noćno plava', '#191970'),
+        ('Orhideja', '#DA70D6'),
+        ('Papaja', '#FFEFD5'),
+        ('Peru', '#CD853F'),
+        ('Plava', '#0000FF'),
+        ('Plavi prah', '#B0E0E6'),
+        ('Plavi škriljevac', '#6A5ACD'),
+        ('Plavkasta', '#F0F8FF'),
+        ('Plavo cvijeće', '#6495ED'),
+        ('Plavo nebo', '#87CEEB'),
+        ('Plavoljubičasta', '#8A2BE2'),
+        ('Porculanska', '#FFE4C4'),
+        ('Prljavomaslinasta', '#6B8E23'),
+        ('Proljetnozelena', '#00FF7F'),
+        ('Prozirno bijela', '#F8F8FF'),
+        ('Pšenica', '#F5DEB3'),
+        ('Purpurna', '#800080'),
+        ('Rajčica', '#FF6347'),
+        ('Rumena lavanda', '#FFF0F5'),
+        ('Ružičasta', '#FFC0CB'),
+        ('Ružičastosmeđa', '#BC8F8F'),
+        ('Siva', '#808080'),
+        ('Sivi škriljevac', '#708090'),
+        ('Sivožuta', '#F0E68C'),
+        ('Smeđa', '#A52A2A'),
+        ('Smeđe sedlo', '#8B4513'),
+        ('Smeđi pijesak', '#F4A460'),
+        ('Smeđkasto bijela', '#FFDEAD'),
+        ('Snijeg', '#FFFAFA'),
+        ('Srebrna', '#C0C0C0'),
+        ('Srednja akvamarin', '#66CDAA'),
+        ('Srednja crvenoljubičasta', '#C71585'),
+        ('Srednja morskozelena', '#3CB371'),
+        ('Srednja orhideja', '#BA55D3'),
+        ('Srednja plava', '#0000CD'),
+        ('Srednja proljetnozelena', '#00FA9A'),
+        ('Srednja purpurna', '#9370DB'),
+        ('Srednja tirkizna', '#48D1CC'),
+        ('Srednje plavi škriljevac', '#7B68EE'),
+        ('Svijetla čeličnoplava', '#B0C4DE'),
+        ('Svijetla narančastoružičasta', '#FFA07A'),
+        ('Svijetli cijan', '#E0FFFF'),
+        ('Svijetlo drvo', '#DEB887'),
+        ('Svijetlokoraljna', '#F08080'),
+        ('Svijetlomorskozelena', '#20B2AA'),
+        ('Svijetloplava', '#ADD8E6'),
+        ('Svijetloružičasta', '#FFB6C1'),
+        ('Svijetlosiva', '#D3D3D3'),
+        ('Svijetlosivi škriljevac', '#778899'),
+        ('Svijetlozelena', '#90EE90'),
+        ('Svijetložuta kudelja', '#FAFAD2'),
+        ('Svijetložuta', '#FFFFE0'),
+        ('Šamotna opeka', '#B22222'),
+        ('Školjka', '#FFF5EE'),
+        ('Šljiva', '#DDA0DD'),
+        ('Tamna kudelja', '#B8860B'),
+        ('Tamna magenta', '#8B008B'),
+        ('Tamna narančastoružičasta', '#E9967A'),
+        ('Tamna orhideja', '#9932CC'),
+        ('Tamna sivožuta', '#BDB76B'),
+        ('Tamni cijan', '#008B8B'),
+        ('Tamno zelena', '#006400'),
+        ('Tamnocrvena', '#8B0000'),
+        ('Tamnoljubičasta', '#9400D3'),
+        ('Tamnomaslinasta', '#556B2F'),
+        ('Tamnonarančasta', '#FF8C00'),
+        ('Tamnoplava', '#00008B'),
+        ('Tamnoplavi škriljevac', '#483D8B'),
+        ('Tamnosiva', '#A9A9A9'),
+        ('Tamnosivi škriljevac', '#2F4F4F'),
+        ('Tamnotirkizna', '#00CED1'),
+        ('Tamnozelena', '#8FBC8F'),
+        ('Tirkizna', '#40E0D0'),
+        ('Topla ružičasta', '#FF69B4'),
+        ('Vedro nebo', '#87CEFA'),
+        ('Voda', '#00FFFF'),
+        ('Zelena lipa', '#32CD32'),
+        ('Zelena šuma', '#228B22'),
+        ('Zelena tratina', '#7CFC00'),
+        ('Zelena', '#008000'),
+        ('Zeleni liker', '#7FFF00'),
+        ('Zelenožuta', '#ADFF2F'),
+        ('Zlatna', '#FFD700'),
+        ('Žućkastocrvena zemlja', '#CD5C5C'),
+        ('Žućkastoružičasta', '#FFE4E1'),
+        ('Žućkastosmeđa glina', '#A0522D'),
+        ('Žuta svila', '#FFF8DC'),
+        ('Žuta', '#FFFF00'),
+        ('Žutozelena', '#9ACD3'),
+    ))
+
+    safe_colors = (
+        'crna', 'kestenjasta', 'zelena', 'mornarska', 'maslinasta',
+        'purpurna', 'modrozelena', 'lipa', 'plava', 'srebrna',
+        'siva', 'žuta', 'fuksija', 'voda', 'bijela',
+    )
+
diff --git a/faker/providers/date_time/__init__.py b/faker/providers/date_time/__init__.py
index 8b76e429..f4d2626b 100644
--- a/faker/providers/date_time/__init__.py
+++ b/faker/providers/date_time/__init__.py
@@ -360,7 +360,7 @@ class Provider(BaseProvider):
         start_date = cls._parse_date_time(start_date, tzinfo=tzinfo)
         end_date = cls._parse_date_time(end_date, tzinfo=tzinfo)
         timestamp = random.randint(start_date, end_date)
-        return datetime.fromtimestamp(timestamp, tzinfo)
+        return datetime(1970, 1, 1,tzinfo=tzinfo) + timedelta(seconds=timestamp)
 
     @classmethod
     def future_datetime(cls, end_date='+30d', tzinfo=None):
diff --git a/faker/providers/misc/__init__.py b/faker/providers/misc/__init__.py
index d219e0c5..679f84b9 100644
--- a/faker/providers/misc/__init__.py
+++ b/faker/providers/misc/__init__.py
@@ -5,6 +5,7 @@ import hashlib
 import string
 import uuid
 import os
+import sys
 
 from faker.generator import random
 from faker.providers.date_time import Provider as DatetimeProvider
@@ -91,7 +92,8 @@ class Provider(BaseProvider):
 
         Default blob size is 1 Mb.
         """
-        return os.urandom(length)
+        blob = [random.randrange(256) for o in range(length)]
+        return bytes(blob) if sys.version_info[0] >= 3 else bytearray(blob)
 
     @classmethod
     def md5(cls, raw_output=False):


Test patch:
diff --git a/tests/factory.py b/tests/factory.py
index 30e800ac..65aa47f9 100644
--- a/tests/factory.py
+++ b/tests/factory.py
@@ -171,13 +171,21 @@ class FactoryTestCase(unittest.TestCase):
 
     def test_binary(self):
         from faker.providers.misc import Provider
-
+       
         for _ in range(999):
             length = random.randint(0, 2 ** 10)
             binary = Provider.binary(length)
 
-            self.assertTrue(isinstance(binary, six.binary_type))
+            self.assertTrue(isinstance(binary, (bytes, bytearray)))
             self.assertTrue(len(binary) == length)
+        
+        for _ in range(999):
+            self.generator.seed(_)
+            binary1 = Provider.binary(_)
+            self.generator.seed(_)
+            binary2 = Provider.binary(_)
+            
+            self.assertTrue(binary1 == binary2)
 
     def test_language_code(self):
         from faker.providers.misc import Provider