aabadie: @lesteve, I addressed your previous comments and squashed the commits.
lesteve: Thanks a lot, merging !
diff --git a/joblib/hashing.py b/joblib/hashing.py
index a6e5337..ced817b 100644
--- a/joblib/hashing.py
+++ b/joblib/hashing.py
@@ -189,7 +189,11 @@ class NumpyHasher(Hasher):
         if isinstance(obj, self.np.ndarray) and not obj.dtype.hasobject:
             # Compute a hash of the object
             # The update function of the hash requires a c_contiguous buffer.
-            if obj.flags.c_contiguous:
+            if obj.shape == ():
+                # 0d arrays need to be flattened because viewing them as bytes
+                # raises a ValueError exception.
+                obj_c_contiguous = obj.flatten()
+            elif obj.flags.c_contiguous:
                 obj_c_contiguous = obj
             elif obj.flags.f_contiguous:
                 obj_c_contiguous = obj.T

Regression: joblib.hash fails on 0d array
```python
import numpy as np
import joblib

arr = np.array(0)
joblib.hash(arr)
```

Works with joblib 0.9.4 and fails on master with the following error:
```
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-4-c182cb63f185> in <module>()
----> 1 joblib.hash(arr)

/home/le243287/dev/alt-scikit-learn/sklearn/externals/joblib/hashing.py in hash(obj, hash_name, coerce_mmap)
    256     else:
    257         hasher = Hasher(hash_name=hash_name)
--> 258     return hasher.hash(obj)

/home/le243287/dev/alt-scikit-learn/sklearn/externals/joblib/hashing.py in hash(self, obj, return_digest)
     66     def hash(self, obj, return_digest=True):
     67         try:
---> 68             self.dump(obj)
     69         except pickle.PicklingError as e:
     70             e.args += ('PicklingError while hashing %r: %r' % (obj, e),)

/volatile/le243287/miniconda3/lib/python3.5/pickle.py in dump(self, obj)
    406         if self.proto >= 4:
    407             self.framer.start_framing()
--> 408         self.save(obj)
    409         self.write(STOP)
    410         self.framer.end_framing()

/home/le243287/dev/alt-scikit-learn/sklearn/externals/joblib/hashing.py in save(self, obj)
    205             # taking the memoryview.
    206             self._hash.update(
--> 207                 self._getbuffer(obj_c_contiguous.view(self.np.uint8)))
    208 
    209             # We store the class, to be able to distinguish between

ValueError: new type not compatible with array.
```

Full disclosure I discovered this when running the nilearn tests using joblib master.
diff --git a/joblib/test/test_hashing.py b/joblib/test/test_hashing.py
index b197167..d36e4d8 100644
--- a/joblib/test/test_hashing.py
+++ b/joblib/test/test_hashing.py
@@ -402,6 +402,16 @@ def test_hashes_are_different_between_c_and_fortran_contiguous_arrays():
     assert_not_equal(hash(arr_c), hash(arr_f))
 
 
+@with_numpy
+def test_0d_array():
+    hash(np.array(0))
+
+
+@with_numpy
+def test_0d_and_1d_array_hashing_is_different():
+    assert_not_equal(hash(np.array(0)), hash(np.array([0])))
+
+
 @with_numpy
 def test_hashes_stay_the_same_with_numpy_objects():
     # We want to make sure that hashes don't change with joblib

pip install -e .
parse_log_pytest
nose coverage numpy>=1.6.1 pytest
apt-get update apt-get install -y gcc
3.5
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs==22.2.0
certifi==2021.5.30
coverage==6.2
importlib-metadata==4.8.3
iniconfig==1.1.1
-e git+https://github.com/joblib/joblib.git@6393c7ee293980963541384dc9573e09116f4734#egg=joblib
nose==1.3.7
numpy==1.19.5
packaging==21.3
pluggy==1.0.0
py==1.11.0
pyparsing==3.1.4
pytest==7.0.1
tomli==1.2.3
typing_extensions==4.1.1
zipp==3.6.0

name: joblib
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - attrs==22.2.0
      - coverage==6.2
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - nose==1.3.7
      - numpy==1.19.5
      - packaging==21.3
      - pluggy==1.0.0
      - py==1.11.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - tomli==1.2.3
      - typing-extensions==4.1.1
      - zipp==3.6.0
prefix: /opt/conda/envs/joblib

joblib/test/test_hashing.py::test_0d_array joblib/test/test_hashing.py::test_0d_and_1d_array_hashing_is_different
joblib/test/test_hashing.py::test_memory_setup_func joblib/test/test_hashing.py::test_memory_teardown_func joblib/test/test_hashing.py::test_hash_methods joblib/test/test_hashing.py::test_numpy_datetime_array joblib/test/test_hashing.py::test_hash_numpy_noncontiguous joblib/test/test_hashing.py::test_hash_numpy_performance joblib/test/test_hashing.py::test_bound_methods_hash joblib/test/test_hashing.py::test_bound_cached_methods_hash joblib/test/test_hashing.py::test_hash_object_dtype joblib/test/test_hashing.py::test_numpy_scalar joblib/test/test_hashing.py::test_dict_hash joblib/test/test_hashing.py::test_set_hash joblib/test/test_hashing.py::test_string joblib/test/test_hashing.py::test_dtype joblib/test/test_hashing.py::test_hashes_are_different_between_c_and_fortran_contiguous_arrays joblib/test/test_hashing.py::test_hashing_pickling_error
joblib/hashing.py
joblib/hashing.py